(def past-visitors (ref #{}))

(defn hello
  "Writes out hello greetings based
   on whether you've called the function
   with the same username before"
  [username]
  (dosync
   (let [past (@past-visitors username)]
     (if past
       (str "Welcome back, " username)
       (do ; else
	 (alter past-visitors conj username)
	 (str "Hello, " username))))))